#!/usr/bin/python
#-*- coding:utf-8 -*-

''
__author__  = 'CreGu'

import urllib
import urllib2

def m1():
    url = "http://www.ishadowsocks.org/"
    response = urllib.urlopen(url)
    print response.read()

def m2():
    url = "https://passport.cnblogs.com/user/signin?ReturnUrl=http%3A%2F%2Fwww.cnblogs.com%2F"
    url = "http://www.baidu.com"
    request = urllib2.Request(url)
    response = urllib2.urlopen(request)
    print response.read()

def m3():
    url = "https://passport.csdn.net/account/login?from=http://my.csdn.net/my/mycsdn"
    values = {}
    values['username'] = "cregu"
    values['password'] = "guvivi@168"
    values['lt'] = "LT-413239-rJ5KbfbPDHnr2ZBlyRtmp1DSxCm2VR"

    data = urllib.urlencode(values)

    user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'
    headers = {'User-Agent': user_agent}

    print data
    request = urllib2.Request(url, data, headers)
    response = urllib2.urlopen(request)
    print response.read()

m3()